package com.jake.split;

public class JiraSplitUtils {

    public static String[] splitJiraTask(String task) {
        if (task == null) {
            return null;
        }
        String[] arr = new String[3];
        String[] split = task.split(": ", 2);
        String[] split1 = split[0].split("-");
        if (split1.length == 2) {
            arr[0] = split1[0];
            arr[1] = split1[1];
            arr[2] = split[1];
        }
        for (String elem : arr) {
            if (elem == null || elem.isEmpty()) {
                return null;
            }
        }
        return arr;
    }
}
